package main

import (
	"ginProject/biz/model"
	"ginProject/biz/utils"
	"github.com/shopspring/decimal"
)

func main() {
	//fmt.Println(utils.GetMD5("12345"))
	//fmt.Println(utils.Success)
	//t:=utils.GetTime()
	//var customerLogin =model.CustomerLogin{IsAdmin: 1,Password: utils.GetMD5("2018211431"),
	//	LoginName: "2018211431",CreateTime: t,ModifiedTime: t,Status: 1}
	//var s int
	//fmt.Println(s)
	//utils.AddCustomer("111","222")
	//fmt.Println(utils.GetCustomer("111"))
	//utils.First()
	//utils.DeleteCustomer("111")
	//fmt.Println(utils.GetCustomer("111"))
	//var m sync.Map
	//m.Store("11",11)
	//m.Store("11",22)
	//m.Store("11",33)
	//fmt.Println(m.Load("12"))
	//first:=service.QueryAllFirst()
	//fmt.Println(first)
	//fmt.Println(json.Marshal(first))
	//fmt.Println(strconv.Itoa(1))
	//maxId:=model.SelectMaxId().ID
	//fmt.Println(maxId)
	//fmt.Println(strconv.Itoa(maxId+1))
	//c:=CustomerInfo{ID: 1,CustomerId: 2}
	//utils.ReturnOKMessage(c,gin.Context{})
	//var p []model.ProductCategory
	//db.Row("select * from product_category where level=2 and " +
	//	"parent_id =(SELECT id  from product_category where name=? " +
	//	"and parent_id=0 and level=1)","车载电器").Scan(&p)
	//fmt.Println(model.SelectSecondCategoryByName(""))
	//fmt.Println((len("")))
	//fmt.Println(model.QueryByName("1231").ID)
	//fmt.Println(utils.GetColor(8))
	//fmt.Println(utils.GetIndex("红色"))
	t := utils.GetTime()
	productInfo := model.ProductInfo{Encoding: "1111", Name: "1111", Price: decimal.NewFromInt(3),
		AverageCost: decimal.NewFromInt(2), RecommendDescript: "好", Descript: "稳",
		OneCategoryId: 1, TwoCategoryId: 10, CreateTime: t, ModifiedTime: t, ProductionDate: t,
		ColorType: 1}
	model.InsertProduct(productInfo)
}
